@using ZKEACMS.Shop.ViewModel
@model OrderDetailViewModel
@{
    Layout = Layouts.CustomerCenter;
    ViewBag.Title = L("订单明细").Text;
    if (Model.Order == null)
    {
        return;
    }
}
<div class="panel panel-default">
    <div class="panel-heading clearfix">
        <div class="pull-left">
            <span>
                @L("订单号：")
                @Model.Order.ID
            </span>
            <label class="badge">
                @Model.Order.OrderStatusText()
            </label>
            @if (Model.Order.TrackingNumber.IsNotNullAndWhiteSpace())
            {
                <span>@L("运单：")</span>
                @Model.Order.LogisticsCompany
                <a href="https://www.baidu.com/s?wd=@(Model.Order.LogisticsCompany+" "+Model.Order.TrackingNumber)" target="_blank">
                    @Model.Order.TrackingNumber
                </a>
            }
        </div>
        <div class="pull-right">
            <small>
                @Model.Order.CreateDate.Value.ToString("yyyy/MM/dd")
            </small>
        </div>
    </div>
    <table class="table table-bordered">
        @foreach (var item in Model.OrderItems)
        {
            <tr>
                <td width="150">
                    <img src="@Url.Content(item.ImageUrl)" />
                </td>
                <td>
                    <h4>@item.Title</h4>
                    <p>@item.Description</p>
                    <p>
                        @L("￥")
                        @item.Price.ToString("F2")
                        x
                        @item.Quantity
                    </p>
                </td>
                @if (item == Model.OrderItems.First())
                {
                    <td width="200" align="center" style="vertical-align:middle" rowspan="@Model.OrderItems.Count">
                        @L("合计：")
                        @L("￥")
                        @Model.Order.Total.ToString("F2")
                    </td>
                }
            </tr>
        }
    </table>

</div>